x11/surface: Remember the toplevel layout
authorJonas Ådahl <jadahl@gmail.com>
Sat, 5 Dec 2020 10:30:45 +0000 (11:30 +0100)
committerJonas Ådahl <jadahl@gmail.com>
Mon, 7 Dec 2020 19:37:29 +0000 (20:37 +0100)
gdk/x11/gdksurface-x11.c
gdk/x11/gdksurface-x11.h

index 8c65183f5d2b5a4df9f0943b5d3de4d2b95b5fc4..b5db385093c956947ca9cbdd5ceab61748c2130d 100644 (file)
@@ -1580,6 +1580,7 @@ gdk_x11_surface_hide (GdkSurface *surface)
                                     NextRequest (GDK_SURFACE_XDISPLAY (surface)));
 
   g_clear_handle_id (&impl->compute_size_source_id, g_source_remove);
+  g_clear_pointer (&impl->toplevel_layout, gdk_toplevel_layout_unref);
 
   gdk_x11_surface_withdraw (surface);
 }
@@ -5054,6 +5055,9 @@ gdk_x11_toplevel_present (GdkToplevel       *toplevel,
 
   gdk_x11_surface_unminimize (surface);
 
+  g_clear_pointer (&impl->toplevel_layout, gdk_toplevel_layout_unref);
+  impl->toplevel_layout = gdk_toplevel_layout_copy (layout);
+
   monitor = gdk_display_get_monitor_at_surface (display, surface);
   if (monitor)
     {
index 994d1250360d79129c2645cd9c14f12ca795b64e..134ebdf617f04d448fd9fd237ad4fa2827555806 100644 (file)
@@ -72,6 +72,8 @@ struct _GdkX11Surface
   int unscaled_width;
   int unscaled_height;
 
+  GdkToplevelLayout *toplevel_layout;
+
   struct {
     int configured_width;
     int configured_height;